<template>
	<view class="content">
		<!-- 电量显示栏-->
		<view class="top_nav">
			<view class="kong"></view>
			<view class="tab_item">
				<view class="return" @click="returnPage">
					<image src="https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/course/jiantou.png"></image>
				</view>
				<view class="title">{{problem_title}}</view>
				<view class="return"></view>
			</view>
		</view>
		
		<!-- 富文本 -->
		<view class="answer_wrap">
			<rich-text :nodes="answer"></rich-text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				problem_id:'',
				problem_title:'',
				answer:[],
				token:'',
				shop_id:'',
			}
		},
		onLoad(options) {
			this.token=options.token
			this.shop_id=options.shop_id
			this.problem_id = options.id;
			this.problem_title = options.title;
			this.get_answer();
		},
		methods: {
			// 返回上一页
			returnPage(){
				uni.navigateBack({
					delta:1
				})
			},
			// 获取问题答案
			get_answer(){
				var url = '/api/home/help_center/details';
				let params = {
					id:this.problem_id,
					token:this.token
				};
				
				this.Unfold_data.upload_data(params, 'GET', url, res => {
					// console.log(res)
					if (res.statusCode == 200 && res.data.code == 1) {
						this.answer = res.data.data.content;
					}
				});
			}
		}
	}
</script>

<style lang="scss">
.content {
	width: 100%;
	position: relative;
	.top_nav{
		width: 100%;
		height: 200upx;
		background-image: url('https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/buy/1.png');
		background-size: cover;
		position: fixed;
		top: 0;
		left: 0;
		z-index: 10;
		.kong{
			width: 100%;
			height: 60upx;
		}
		.tab_item{
			width: 90%;
			margin: 0 auto;
			height: 140upx;
			display: flex;
			align-items: center;
			justify-content: center;
			.return{
				flex: 1;
				width: 100%;
				image{
					width: 29upx;
					height: 29upx;
				}
			}
			.title{
				flex: 8;
				width: 100%;
				color: #ffffff;
				display: flex;
				align-items: center;
				justify-content: center;
				z-index: 10;
				display: -webkit-box;
				overflow: hidden;
				-webkit-box-orient:vertical;
				-webkit-line-clamp:1;
			}
		}
	}
	.answer_wrap{
		width: 90%;
		margin: 0 auto;
		padding-top: 220upx;
	}
}
</style>
